/**     
* @Title: HomeController.java   
* @Package me.security.example.controller   
* @Description: TODO   
* @author xaoyaoyao
* @date 2017年8月23日 下午12:38:13
*/
package me.security.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import me.security.example.domain.Msg;

/**
 * @ClassName: HomeController
 * @Description: TODO
 * @author xaoyaoyao
 * @date 2017年8月23日 下午12:38:13
 * 
 */
@Controller
public class HomeController {

	@RequestMapping("/")
	public String index(Model model) {
		Msg msg = new Msg("测试标题", "测试内容", "欢迎来到HOME页面,您拥有 ROLE_HOME 权限");
		model.addAttribute("msg", msg);
		return "home";
	}

	@RequestMapping("/login")
	public String login() {
		return "login";
	}

	@RequestMapping("/admin")
	@ResponseBody
	public String hello() {
		return "hello admin";
	}
}
